<%@page import="java.text.*"%>
<%@ page language="java" import="java.util.*, java.sql.*" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Movement Report</title>
</head>
<body>
	<div style="width: 300px;height: 100%; float: left">
		<a href="Overview" style="width: 300px;float: left">Overview</a>
		<a href="Structures" style="width: 300px;float: left">Structures</a>
		<a href="Research" style="width: 300px;float: left">Research</a>
		<a href="Barracks" style="width: 300px;float: left">Barracks</a>
		<a href="Island" style="width: 300px;float: left">Island</a>
		<a href="Movement" style="width: 300px;float: left">Movement Report</a>
		<a href="Messages" style="width: 300px;float: left">Messages</a>
	</div>
	<table border="1" cellspacing="0">
		<tr>
			<th>Start Time</th>
			<th>Arrival Time</th>
			<th>Resources</th>
			<th>Destination</th>
			<th>Player Name</th>
		</tr>
<%
	ArrayList<Integer> MOV_ID = (ArrayList<Integer>)request.getAttribute("MOV_ID");
	ArrayList<Timestamp> START_TIME = (ArrayList<Timestamp>)request.getAttribute("START_TIME");
	ArrayList<Timestamp> ARRIVAL_TIME = (ArrayList<Timestamp>)request.getAttribute("ARRIVAL_TIME");
	ArrayList<Integer> QUANTITY = (ArrayList<Integer>)request.getAttribute("QUANTITY");
	ArrayList<Integer> SOURCE_ADDRESS = (ArrayList<Integer>)request.getAttribute("SOURCE_ADDRESS");
	ArrayList<Integer> DESTINATION = (ArrayList<Integer>)request.getAttribute("DESTINATION_ADDRESS");
	ArrayList<Integer> TARGET_NAME = (ArrayList<Integer>)request.getAttribute("TARGET_NAME");
	ArrayList<Integer> T_USER_ID = (ArrayList<Integer>)request.getAttribute("T_USER_ID");
	Iterator<Integer> iter = MOV_ID.iterator();
	
	while(iter.hasNext()){
		Integer next = iter.next();
		int index = MOV_ID.indexOf(next);
		%>
		<tr>
			<td><%out.print(new SimpleDateFormat("dd/mon/yyyy h:mm").format(START_TIME.get(index)));%></td>
			<td><%out.print(new SimpleDateFormat("dd/mon/yyyy h:mm").format(ARRIVAL_TIME.get(index)));%></td>
			<td><%=QUANTITY.get(index)%></td>
			<td><%=DESTINATION.get(index)%></td>
			<td><%=TARGET_NAME.get(index)%></td>
		</tr>
		
		<%
		
		
	}
	
%>
	</table>
</body>
</html>